package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TA_BILL database table.
 * 
 */
@Embeddable
public class TaBillPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long idDiar;
	private String coBimo;

    public TaBillPK() {
    }

	@Column(name="ID_DIAR", unique=true, nullable=false)
	public long getIdDiar() {
		return this.idDiar;
	}
	public void setIdDiar(long idDiar) {
		this.idDiar = idDiar;
	}

	@Column(name="CO_BIMO", unique=true, nullable=false, length=2)
	public String getCoBimo() {
		return this.coBimo;
	}
	public void setCoBimo(String coBimo) {
		this.coBimo = coBimo;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TaBillPK)) {
			return false;
		}
		TaBillPK castOther = (TaBillPK)other;
		return 
			(this.idDiar == castOther.idDiar)
			&& this.coBimo.equals(castOther.coBimo);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.idDiar ^ (this.idDiar >>> 32)));
		hash = hash * prime + this.coBimo.hashCode();
		
		return hash;
    }
}